package com.gxa.controller.monthgoals;

import com.gxa.common.R;
import com.gxa.pojo.Monthly_Goals;
import com.gxa.pojo.goalPojo.GoalPojo;
import com.gxa.utils.DateUtils;
import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/activityQuery")
@Api(value = "月度目标",tags = "月度目标接口API")
public class activitySearch {
    @RequestMapping(value = "/queryActivity",method = RequestMethod.GET)
    @ApiOperation(value = "月度目标信息",notes = "月度目标信息接口",httpMethod = "GET", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R activitySerche(){
        R r=new R();
        GoalPojo goalPojo=new GoalPojo();
        Monthly_Goals mg=new Monthly_Goals();
        goalPojo.setMonthly_Goals_Id(1);
        goalPojo.setEmp_name("管理员");
        goalPojo.setTitle("nihao");
        goalPojo.setEntry_Date(DateUtils.getCurrentDate());
        r.setCode(200);
        r.setMsg("success");
        r.setData(mg);
        return r;
    }
    @RequestMapping(value = "/editActivity",method = RequestMethod.GET)
    @ApiOperation(value = "编辑月度信息",notes = "编辑月度信息接口",httpMethod = "GET", response = GoalPojo.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "title",value = "标题",required = true, dataType = "String",paramType = "query"),
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R activityEdit(String title){
        R r=new R();
        List<GoalPojo> list=new ArrayList<>();
        GoalPojo goalPojo=new GoalPojo();
        goalPojo.setGoal_Thead1("一");
        goalPojo.setGoal_Thead2("二");
        goalPojo.setGoal_Thead3("目标三");
        goalPojo.setGoal_Thead4("目标四");
        goalPojo.setGoal_Thead5("目标五");
        goalPojo.setGoal_Thead6("目标六");
        goalPojo.setMonthly_Goals_Id(1);
        goalPojo.setEmp_name("管理员");
        goalPojo.setTitle("nihao");
        goalPojo.setEntry_Date(DateUtils.getCurrentDate());
        list.add(goalPojo);
        r.setCode(200);
        r.setMsg("success");
        r.setData(list);
        return r;
    }


}
